let obj = {};
let temp = {
    name: 'Hello world'
};
let input = document.getElementById('input');

Object.defineProperty(obj, 'name', {
    get(){
        return temp['name'];
    },
    set(val){
        temp['name'] = val;
        input.value = val;
    }
})

input.value = obj.name;

input.addEventListener('input', function(){
    obj.name = this.value;
})
